declare @uid int, @phone_id int
set @uid=66
select @phone_id=id from phones where uid=@uid
delete from user_sessions where phone_id=@phone_id
delete from phones where uid=@uid
delete from accounts where uid=@uid
delete from users where id=@uid